import axios from 'axios';

// 定义基础 URL，实际开发中可以从环境变量获取
const BASE_URL = '/api';

// 抖音相关接口
export const douyinApi = {

    getVideoId(shareUrl) {
        return axios.get(`${BASE_URL}/video`, {
            params: {shareUrl}
        });
    },

    playVideoUrl(videoId) {
        return axios.get(`${BASE_URL}/video/url`, {
            params: {videoId}
        });
    },

    // 获取视频详情
    getVideoDetail(videoId) {
        return axios.get(`${BASE_URL}/video/detail`, {
            params: {videoId}
        });
    },

    // 获取视频评论
    getVideoComments(videoId) {
        return axios.get(`${BASE_URL}/video/comments`, {
            params: {videoId}
        });
    },

    // 搜索视频
    searchVideos(keyword) {
        return axios.get(`${BASE_URL}/video/search`, {
            params: {keyword}
        });
    },

    // 获取用户信息
    getUserInfo(userId) {
        return axios.get(`${BASE_URL}/user/info`, {
            params: {userId}
        });
    },

    // 获取视频文案
    getVideoScript(videoId) {
        return axios.get(`${BASE_URL}/video/ocr`, {
            params: { videoId }
        });
    },
}; 